package com.runshu.runshuwulian.ui.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.hyphenate.easeui.mwidget.brvahrecyclerview.BaseQuickAdapter;
import com.hyphenate.easeui.mwidget.brvahrecyclerview.BaseViewHolder;
import com.runshu.runshuwulian.R;
import com.runshu.runshuwulian.bean.GoodsBean;
import com.runshu.runshuwulian.utils.UtilLoadImage;

import java.util.List;

public class ScanGoodsAdapter extends BaseQuickAdapter<GoodsBean, BaseViewHolder> {


    public ScanGoodsAdapter(@Nullable List<GoodsBean> data) {
        super( R.layout.item_scangoods, data );
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, GoodsBean item) {
        UtilLoadImage.loadImage( mContext, helper.getView( R.id.iv ), item.getImageUrl() );
        helper.setText( R.id.tv_code, item.getSerialNo() );
        helper.setText( R.id.tv_name, item.getProductName() );
        helper.addOnClickListener( R.id.bt_delete );
    }
}
